package com.ft.oa.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class ResourceConfigAdapter implements WebMvcConfigurer {

    //对静态资源的配置

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //addResourceHandler(/file/)所有开头的请求都会去后面配置
        registry.addResourceHandler("/file/**").addResourceLocations("file:D:/test/");
    }
}
